package Currency;
sub new
{
    my $class = shift;
    my $self = {
        UAH => "UAH",
        RUR => "RUR",
        USD => "USD",
        PER10 => "PER10",
        PER100 => "PER100",
        PER1000 => "PER1000",
        PER10000 => "PER10000"
    };
    bless $self, $class;
    return $self;
}
package StringBuilder;
sub new
{
    my $class = shift;
    my $self = {
        _buffer => []
    };
    bless $self, $class;
    return $self;
}
sub append {
    my( $self, $text ) = @_;
    push(@{$self->{_buffer}}, $text);
    return $self;
}
sub insert {
    my( $self, $index, $text ) = @_;
    splice(@{$self->{_buffer}}, $index, 0, $text);
    return $self;
}
sub deleteCharAt {
    my( $self, $index ) = @_;
    $str = $self->toString();
    $self->{_buffer} = [];
    $self->append(substr($str, 0, $index));
    return $self;
}
sub toString {
    my( $self ) = @_;
    return join("", @{$self->{_buffer}});
}
$sb = new StringBuilder();
$sb->append("123");
$sb->append("456");
$sb->insert(0, "ABC");
print $sb->toString();
